package com.yuanfeng.order.controller;


import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.yuanfeng.commoms.dto.PageUserTokenBeanDTO;
import com.yuanfeng.commoms.dto.order.PlatFormMemberSelfQueryDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.order.dto.*;
import com.yuanfeng.order.utils.interfacerepeatedcalls.AccessLimit;
import io.seata.core.exception.TransactionException;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.Map;

/**
 * @ClassName OrderBaseController
 * @Description 订单详细信息
 * @Author cyp
 * @Date 2023-06-06 15:00:48
 * @Version 1.0
 **/
@RestController
@RequestMapping("order/base")
public class OrderBaseController extends BaseController {
    /**
     * 支付时查询商品实付金额
     *
     * @param map
     * @return
     */
    @PostMapping("/queryAmountPaid")
    public ResponseResult queryAmountPaid(@RequestBody Map<String, String> map) {
        ResponseResult result = orderBaseService.queryAmountPaid(map);
        return result;
    }

    /**
     * 查询用户已兑换的用户积分数量
     */
    @PostMapping("/queryIntegraOrdersCount")
    public ResponseResult queryIntegraOrdersCount(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryintegraOrdersCount(map);
        return result;
    }

    /**
     * 查询是否多订单 fegin
     *
     * @param map
     * @return
     */
    @PostMapping("/queryShopIdByOrderIdNum")
    public Integer queryShopIdByOrderIdNum(@RequestBody Map<String, Object> map) {
        Integer integer = orderBaseService.queryShopIdByOrderIdNum(map);
        return integer;
    }

    /**
     * 查询店铺信息 fegin
     *
     * @param map
     * @return
     */
    @PostMapping("/queryShopIdByOrderInfo")
    public ResponseResult queryShopIdByOrderInfo(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryShopIdByOrderInfo(map);
        return result;
    }

    /**
     * 查询商品数量 fegin
     *
     * @param map
     * @return
     */
    @PostMapping("/queryShopIdByOrderIdCount")
    public Integer queryGoodNumByOrderId(@RequestBody Map<String, Object> map) {
        Integer integer = orderBaseService.queryGoodNumByOrderId(map);
        return integer;
    }

    /**
     * 订单消息
     *
     * @param map
     * @return
     */
    @PostMapping("/messageToRemind")
    public ResponseResult messageToRemind(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.messageToRemind(map);
        return result;
    }

    /**
     * 判断订单状态已辨用作删除
     *
     * @param map
     * @return
     */
    @PostMapping("/deleteOrder")
    public ResponseResult deleteOrder(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.deleteOrder(map);
        return result;
    }

    /**
     * 取消订单
     *
     * @param map
     * @return
     */
    @PostMapping("/cancelTheOrder")
    public ResponseResult cancelTheOrder(@RequestBody Map<Object, Object> map) throws TransactionException {
        ResponseResult result = orderBaseService.cancelTheOrder(map);
        return result;
    }

    /**
     * 确认收货
     *
     * @param map
     * @return
     */
    @PostMapping("/confirmTheGoods")
    public ResponseResult confirmTheGoods(@RequestBody Map<Object, Object> map) throws TransactionException {
        ResponseResult result = orderBaseService.confirmTheGoods(map);
        return result;
    }

    /**
     * 延迟收货
     *
     * @param map
     * @return
     */
    @PostMapping("/delayToReceiveGoods")
    public ResponseResult delayToReceiveGoods(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.delayToReceiveGoods(map);
        return result;
    }

    /**
     * 查询已售订单信息(订单详情)
     *
     * @param map
     * @return
     */
    @PostMapping("/enquireSoldOrders")
    public ResponseResult enquireSoldOrders(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.enquireSoldOrders(map);
        return result;
    }

    /**
     * 添加评论
     *
     * @param para
     * @return
     */
    @PostMapping("/addComments")
    public ResponseResult addComments(@RequestBody CommentsListDTO para) throws TransactionException {
        ResponseResult result = orderBaseService.addComments(para);
        return result;
    }

    /**
     * 首页订单总数
     *
     * @param map
     * @return
     */
    @PostMapping("/ordersTotal")
    @AccessLimit()//防止恶意请求
    public ResponseResult ordersTotal(@RequestBody Map<Object, Object> map) {
        ResponseResult rr = orderBaseService.ordersTotal(map);
        return rr;
    }

    /**
     * 销量排名
     *
     * @param map
     * @return
     */
    @PostMapping("/salesNo")
    @AccessLimit()//防止恶意请求
    public ResponseResult salesNo(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.salesNo(map);
        return result;
    }

    /**
     * 计算销售额
     *
     * @param map
     * @return
     * @throws IOException
     * @throws JsonMappingException
     * @throws JsonParseException
     */
    @PostMapping("/calculatedSales")
    @AccessLimit()//防止恶意请求
    public ResponseResult calculatedSales(@RequestBody Map<Object, Object> map)
            throws JsonParseException, JsonMappingException, IOException {
        ResponseResult rr = orderBaseService.calculatedSales(map);
        return rr;
    }

    /**
     * 查询虚拟订单未评价订单
     *
     * @param map
     * @return
     */
    @PostMapping("/queryVirtualOrderByEvaluation")
    public ResponseResult queryVirtualOrderByEvaluation(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryVirtualOrderByEvaluation(map);
        return result;
    }

    /**
     * 订单信息查询(兑换记录列表)
     *
     * @param map
     * @return
     */
    @PostMapping("/queryIntegralOrders")
    public ResponseResult queryIntegralOrders(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryIntegralOrders(map);
        return result;
    }

    /**
     * 查询积分未评价订单
     *
     * @param map
     * @return
     */
    @PostMapping("/queryIntegralOrderByEvaluation")
    public ResponseResult queryIntegralOrderByEvaluation(@RequestBody Map<String, Object> map) {
        ResponseResult rr = orderBaseService.queryIntegralOrderByEvaluation(map);
        return rr;
    }

    /**
     * 查询买家订单发票列表
     *
     * @param param Map<Object,Object>
     * @return ResultResp
     */
    @PostMapping("/query/list")
    public ResponseResult queryOrderInvoiceList(@RequestBody Map<String, Object> param) {
        ResponseResult result = orderBaseService.queryOrderInvoiceList(param);
        return result;
    }

    /**
     * 订单之卖出交易(真实订单)
     *
     * @param
     * @return
     * @throws ParseException
     */
    @PostMapping("/platform/orderDetails")
    public ResponseResult orderSellingTransaction(@RequestBody SellingInputDTO sellingPara) {
        ResponseResult result= orderBaseService.orderSellingTransaction(sellingPara);
        return result;
    }

    /**
     * 订单之卖出交易(真实订单)导出
     *
     * @param
     * @return
     * @throws ParseException
     */
    @PostMapping("/platform/orderDetailsExcel")
    public ResponseResult orderSellingTransactionExcel(@RequestBody SellingInputDTO sellingPara) {
        ResponseResult result = orderBaseService.orderSellingTransactionExcel(sellingPara);
        return result;
    }

    /**
     * 订单之订单详情
     *
     * @param
     * @return
     */
    @PostMapping("/platForm/backGroundByOrderDetails")
    public ResponseResult PlatFormBackGroundByOrderDetails(@RequestBody Map<String, Object> buyingPara) {
        ResponseResult result = orderBaseService.PlatFormBackGroundByOrderDetails(buyingPara);
        return result;
    }

    /**
     * 订单之线下订单
     *
     * @param sellingPara
     * @return
     * @throws ParseException
     */
    @PostMapping("/platForm/backGroundBySelling")
    public ResponseResult PlatFormBackGroundBySelling(@RequestBody SellingInputDTO sellingPara){
        ResponseResult result = orderBaseService.PlatFormBackGroundBySelling(sellingPara);
        return result;
    }

    /**
     * 订单之线下订单 excel导出
     *
     * @param para
     * @return
     */
    @PostMapping("/platForm/backGroundBySellingExp")
    public ResponseResult platFormBackGroundBySellingExp(@RequestBody SellingInputDTO para) {
        ResponseResult rr = orderBaseService.PlatFormBackGroundBySellingExp(para);
        return rr;
    }

    /**
     * 根据orderId 获取已经上传的支付凭证信息
     * @return
     */
    @PostMapping("/platform/queryPaymentDetail")
    public ResponseResult querkVocherImages(@RequestBody QukVocherImagesDTO param ){
        ResponseResult result = orderBaseService.querkVocherImages(param);
        return result;
    }

    /**
     * 审核 线下订单 (上传凭证)
     * @return
     */
    @PostMapping("/platform/updatePaymentDetail")
    public ResponseResult checkPaymentVocher(@RequestBody QukVocherImagesDTO param ){
        ResponseResult result = orderBaseService.checkPaymentVocher(param);
        return result;
    }

    /**
     * 判断该订单是否是虚拟订单或者是门店自提订单
     */
    @PostMapping("/isVirtualOrder")
    public  ResponseResult isVirtualOrder(@RequestBody Map<String, String> orderIdIsNum){
        ResponseResult virtualOrder = orderBaseService.isVirtualOrder(orderIdIsNum);
        return virtualOrder;
    }

    /**
     * 为虚拟订单添加兑换码
     */
    @PostMapping("/addRedeemCode")
    public ResponseResult addRedeemCode(@RequestBody Map<String, Object> param){
        ResponseResult result = orderBaseService.addRedeemCode(param);
        return result;
    }

    /**
     * 下单通知
     *
     * @param map
     * @return
     */
    @PostMapping("/orderToInform")
    public ResponseResult orderToInform(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.orderToInform(map);
        return result;
    }

    /**
     * 获取非数字订单
     */
    @PostMapping("/queryUpayByOrderId")
    public ResponseResult queryUpayByOrderId(@RequestBody String order_id) {
        ResponseResult result = orderBaseService.queryUpayByOrderId(order_id);
        return result;
    }

    /**
     * 更新orderBase中支付方式等字段
     *
     * @param map
     * @return
     */
    @PostMapping("/updateByPaymentType")
    public ResponseResult UpdateOrderBaseByPayment(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.UpdateOrderBaseByPayment(map);
        return result;
    }

    /**
     * 更新orderBase中支付方式等字段 feign 支付宝
     *
     * @param map
     * @return
     */
    @PostMapping("/updateByPaymentTypeFegin")
    public boolean fiveUpdateOrderBaseByPayment(@RequestBody Map<Object, Object> map) {
        boolean b = orderBaseService.fiveUpdateOrderBaseByPayment(map);
        return b;
    }

    /**
     * 超出时间申请售后拒绝
     * @param paraMap
     * @return
     */
    @PostMapping("/timeOut")
    public ResponseResult overTimeReturnOrder(@RequestBody Map<String, String> paraMap) throws ParseException {
        ResponseResult result = orderBaseService.overTimeReturnOrder(paraMap);
        return result;
    }

    /**
     * 多单号查询物流信息
     *
     * @param map
     * @return
     */
    @PostMapping("/queryLogistics2")
    public ResponseResult queryLogistics2(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.queryLogistics2(map);
        return result;
    }

    /**
     * 订单之线下订单 导出
     *
     * @param sellingInputDTO
     * @return
     * @throws ParseException
     */
    @PostMapping("/platform/offlineOrderEXcel")
    public ResponseResult PlatFormOfflineOrderEXcel(@RequestBody SellingInputDTO sellingInputDTO) throws ParseException {
        ResponseResult result = orderBaseService.PlatFormOfflineOrderEXcel(sellingInputDTO);
        return result;
    }

    /**
     * 订单之卖出交易
     *
     * @param sellingPara
     * @return
     * @throws ParseException
     */
    @PostMapping("/platForm/selling")
    public ResponseResult PlatFormBackGroundBySellingNew(@RequestBody SellingInputNewDTO sellingPara) throws ParseException, IllegalAccessException {
        ResponseResult result = orderBaseService.PlatFormBackGroundBySellingNew(sellingPara);
        return result;
    }

    /**
     * 订单之卖出交易 导出
     *
     * @param sellingPara
     * @return
     * @throws ParseException
     */
    @PostMapping("/platForm/sellEXcel")
    public ResponseResult platFormOnlineOrdersEXcel(@RequestBody SellingInputNewDTO sellingPara) throws ParseException {
        ResponseResult result = orderBaseService.platFormOnlineOrdersEXcel(sellingPara);
        return result;
    }

    /**
     * 根据订单id查订单信息
     *
     * @param OrderId
     * @return
     */
    @GetMapping("/selectOrderInfoById")
    public ResponseResult selectOrderInfoById(@RequestParam("OrderId") String OrderId) {
        ResponseResult result = orderBaseService.selectOrderInfoById(OrderId);
        return result;
    }

    /**
     * 查询卖家中心订单发票列表
     *
     * @param param Map<Object,Object>
     * @return ResultResp
     */
    @PostMapping("/seller/query/list")
    public ResponseResult querySellerOrderInvoiceList(@RequestBody Map<String,Object> param) {
        ResponseResult result = orderBaseService.querySellerOrderInvoiceList(param);
        return result;
    }

    /**
     * 已售订单
     *
     * @param map
     * @return
     */
    @PostMapping("/soldOrders")
    //防止恶意请求
    @AccessLimit()
    public ResponseResult soldOrders(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.soldOrders(map);
        return result;
    }

    /**
     * 伪删除
     *
     * @param map
     * @return
     */
    @PostMapping("/pseudoDelete")
    //防止恶意请求
    @AccessLimit()
    public ResponseResult pseudoDelete(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.pseudoDelete(map);
        return result;
    }

    /**
     * 平台每日交易额(可按时间查询)
     *
     * @param map
     * @return
     */
    @PostMapping("/platform/tradeByDaily")
    public ResponseResult dailyTurnoverOfThePlatform(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.dailyTurnoverOfThePlatform(map);
        return result;
    }

    /**
     * 平台总交易额(可按时间查询)
     *
     * @param map
     * @return
     */
    @PostMapping("/platform/tradeByTotal")
    public ResponseResult totalTurnoverOfThePlatform(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.totalTurnoverOfThePlatform(map);
        return result;
    }

    /**
     * 店铺排行
     *
     * @param map
     * @return
     */
    @PostMapping("/storeRanking")
    public ResponseResult storeRanking(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.storeRanking(map);
        return result;
    }
    /**
     * 订单详情
     *
     * @param map
     * @return
     */
    @PostMapping("/business/orderDetails")
    //防止恶意请求
    @AccessLimit()
    public ResponseResult businessManageByOrderDetails(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.businessManageByOrderDetails(map);
        return result;
    }

    /**
     * 根据红包编码查询订单详情
     * @param paraMap
     * @return
     */
    @PostMapping("/redpacket/orderDetails")
    public ResponseResult getRedPacketOrder(@RequestBody Map<String, String> paraMap) {
        ResponseResult result = orderBaseService.getRedPacketOrder(paraMap);
        return result;

    }

    /**
     * 订单之自身会员交易
     *
     * @param param
     * @return
     */
    @PostMapping("/query/memberOrderByPage")
    public ResponseResult queryPlatFormMemberSelfPard(@RequestBody PlatFormMemberSelfQueryDTO param) throws IllegalAccessException {
        ResponseResult result = orderBaseService.queryPlatFormMemberSelfPard(param);
        return result;
    }

    /**
     * 积分商品发货
     *
     * @param map
     * @return
     */
    @GlobalTransactional
    @PostMapping("/shipments")
    public ResponseResult shipments(@RequestBody Map<Object, Object> map) throws TransactionException {
        ResponseResult result = orderBaseService.shipments(map);
        return result;
    }

    /**
     * 平台积分商城 兑换列表 删除
     *
     * @param map
     * @return
     */
    @PostMapping("/deleteIntegralOrder")
    public ResponseResult deleteIntegralOrder(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.deleteIntegralOrder(map);
        return result;
    }
    /**
     * 物流消息
     *
     * @return
     */
    @PostMapping("/logisticsInformation")
    public ResponseResult logisticsInformation(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.logisticsInformation(map);
        return result;
    }

    /**
     * 平台查询 交易明细
     *
     * @param param
     * @return
     */
    @PostMapping("/queryMonthsaleReport")
    public ResponseResult queryMonthsaleReport(@RequestBody MonthReportDTO param) {
        ResponseResult result = orderBaseService.queryMonthsaleReport(param);
        return result;
    }

    /**
     * 平台查询 交易明细 导出
     *
     * @param param
     * @return
     */
    @PostMapping("/queryMonthsaleReportExcel")
    public ResponseResult queryMonthsaleReportExcel(@RequestBody MonthReportDTO param) {
        ResponseResult result = orderBaseService.queryMonthsaleReportExcel(param);
        return result;
    }

    /**
     * 平台财务订单 列表导出
     *
     * @param param
     * @return
     */
    @PostMapping("/queryRealOrderSelfPardExcel")
    public ResponseResult queryRealOrderSelfPardExcel(@RequestBody RealOrderSelfDTO param) {
        ResponseResult result = orderBaseService.queryRealOrderSelfPardExcel(param);
        return result;
    }

    /**
     * 平台财务订单 列表查询
     *
     * @param param
     * @return
     */
    @PostMapping("/queryRealOrderSelfPard")
    public ResponseResult queryRealOrderSelfPard(@RequestBody RealOrderSelfDTO param) throws IllegalAccessException {
        ResponseResult result = orderBaseService.queryRealOrderSelfPard(param);
        return result;
    }

    /**
     * 修改订单信息(店铺名)
     *
     * @param map
     * @return
     */
    @PostMapping("/updateByMap")
    public ResponseResult updateByMap(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.updateByMap(map);
        return result;
    }

    /**
     * 查询退保店铺详情
     *
     * @param map
     * @return
     */
    @PostMapping("/query/returnBond/detail")
    public ResponseResult queryReturnBondDetail(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryReturnBondDetail(map);
        return result;
    }

    /**
     * 判断店铺下是否有未完成订单
     *
     * @param map
     * @return
     */
    @PostMapping("/updateShopByOrderInfo")
    public ResponseResult updateShopByOrderInfo(@RequestBody Map<String, Object> map) {
        ResponseResult resultResp = orderBaseService.updateShopByOrderInfo(map);
        return resultResp;
    }

    /**
     * 平台查询积分订单列表
     *
     * @param map
     * @return
     */
    @PostMapping("/queryExchangeList")
    public ResponseResult queryExchangeList(@RequestBody Map<String, Object> map) {
        ResponseResult resultResp = orderBaseService.queryExchangeList(map);
        return resultResp;
    }
    /**
     * 门店订单信息查询
     *
     * @param map
     * @return
     */
    @PostMapping("queryGateOrders")
    public ResponseResult queryGateOrders(@RequestBody Map<String, Object> map){
        ResponseResult resultResp = orderBaseService.queryGateOrders(map);
        return resultResp;
    }

    /**
     * 平台查询用户 购买记录
     *
     * @param map
     * @return
     */
    @PostMapping("/platform/purchaseRecord")
    public ResponseResult queryMemberUserOrderDetail(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryMemberUserOrderDetail(map);
        return result;
    }
    /**
     * 订单信息查询
     *
     * @param map
     * @return
     */
    @PostMapping("/queryOrders")
    public ResponseResult queryOrders(@RequestBody Map<String, Object> map){
        ResponseResult result = orderBaseService.queryOrders(map);
        return result;
    }
    /**
     * 查询未评价订单
     *
     * @param map
     * @return
     */
    @PostMapping("/queryOrderByEvaluation")
    public ResponseResult queryOrderByEvaluation(@RequestBody Map<String, Object> map){
        ResponseResult result = orderBaseService.queryOrderByEvaluation(map);
        return result;
    }

    /**
     * 查询所有虚拟订单
     * @param map
     * @return
     */
    @PostMapping("/virtualOrders")
    public ResponseResult virtualOrders(@RequestBody Map<String, Object> map){
        ResponseResult result = orderBaseService.virtualOrders(map);
        return result;
    }
    /**
     * 供应商  待发货订单
     * @param soldOrderRequest
     * @return
     */
    @PostMapping("/supply/shipmentsByOrder")
    public ResponseResult shipmentsByOrder(@RequestBody SoldOrderRequestDTO soldOrderRequest){
        ResponseResult result = orderBaseService.shipmentsByOrder(soldOrderRequest);
        return result;
    }

    /**
     * 门店管理中心自提订单列表
     * @param map
     * @return
     */
    @PostMapping("/queryGateShopOrders")
    public ResponseResult queryGateShopOrders(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryGateShopOrders(map);
        return result;
    }

    /**
     * web门店 核销订单根据 兑换码 来 查询订单信息
     * @param map
     * @return
     */
    @PostMapping("/query/cancelOrder")
    public ResponseResult webGateShopCancelOrder(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.webGateShopCancelOrder(map);
        return result;
    }

    /**
     * 核销门店订单
     * @param map
     * @return
     */
    @PostMapping("/cancelGateShopOrder")
    public ResponseResult cancelGateShopOrder(@RequestBody Map<String,Object> map){
        ResponseResult result = orderBaseService.cancelGateShopOrder(map);
        return result;
    }

    /**
     * @title virtualOrders
     * @description 门店管理中心自提虚拟订单列表
     * @author s lj
     * @updateTime 2021/7/22 11:14
     * @throws
     */
    @PostMapping("/virtualGateShopOrders")
    public ResponseResult queryVirtualGateShopOrders(@RequestBody Map<String, Object> map){
        ResponseResult result = orderBaseService.queryVirtualGateShopOrders(map);
        return result;
    }
    /**
     * 供应商 已售经销，已售自销订单
     * @param soldOrderRequest
     * @return
     */
    @PostMapping("/supply/soldOrders")
    public ResponseResult soldOrders(@RequestBody SoldOrderRequestDTO soldOrderRequest){
        ResponseResult result = orderBaseService.supplySoldOrders(soldOrderRequest);
        return result;
    }

    /**
     * 查询门店虚拟订单
     * @param map
     * @return
     */
    @PostMapping("/shopGateTakeOrders")
    public ResponseResult shopGateTakeOrders(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.shopGateTakeOrder(map);
        return result;
    }

    /**
     * web核销订单根据兑换码来查询订单信息
     * @param map
     * @return
     */
    @PostMapping("/webCancelOrder")
    public ResponseResult webCancelOrder(@RequestBody Map<String, String> map){
        ResponseResult result = orderBaseService.queryCancelOrderDetails(map);
        return result;
    }

    /**
     * 核销兑换码
     * @param map
     * @return
     */
    @PostMapping("/cancelOrder")
    public ResponseResult cancelOrder(@RequestBody Map<String,Object> map){
        ResponseResult result = orderBaseService.cancelOrder(map);
        return result;
    }


    /**
     * 核销订单
     * @param map
     * @return
     */

    @PostMapping("/business/cancelOrder")
    public ResponseResult businessCancelOrder(@RequestBody Map<String,Object> map) throws TransactionException {
        ResponseResult result = orderBaseService.businessCancelOrder(map);
        return result;
    }

    /**
     * 商家中心--经销管理-经销明细
     * @param map
     * @return
     */
    @PostMapping("/dealerDetailList")
    public ResponseResult dealerDetailList(@RequestBody Map<String, String> map){
        ResponseResult result = orderBaseService.dealerDetailList(map);
        return result;
    }

    /**
     * 更改物流公司与物流编号
     *
     * @param map
     * @return
     */
    @PostMapping("/changeShipments")
    public ResponseResult changeShipments(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.changeShipments(map);
        return result;
    }

    /**
     * 品牌店铺查询会员订单
     * @param param
     * @return
     */
    @PostMapping("/query/memberOrderDetail")
    public ResponseResult queryMemberOrderDetail(@RequestBody Map<String, Object> param) {
        ResponseResult result = orderBaseService.queryMemberOrderDetail(param);
        return result;
    }

    /**
     * 分开发货
     *
     * @param param
     * @return
     */
    @GlobalTransactional
    @PostMapping("/separateShipments")
    public ResponseResult separateShipments(@RequestBody ShipmentsDTO param) throws TransactionException {
        ResponseResult result = orderBaseService.separateShipments(param);
        return result;
    }

    /**
     * 更改收货人商品信息
     *
     * @param map
     * @return
     */
    @PostMapping("/update/addressInformation")
    public ResponseResult updateAddressInformation(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.updateAddressInformation(map);
        return result;
    }

    /**
     * 查询收货人地址信息
     *
     * @param map
     * @return
     */
    @PostMapping("/query/addressInformation")
    public ResponseResult queryAddressInformation(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.queryAddressInformation(map);
        return result;
    }

    /**
     * 导出批量发货
     *
     * @param file
     * @return
     */
    @GlobalTransactional
    @PostMapping("/importShipmentsOrderExport")
    public ResponseResult importShipmentsOrderExport(@RequestParam("file") MultipartFile file) throws TransactionException {
        ResponseResult result = orderBaseService.importShipmentsOrderExport(file);
        return result;
    }

    /**
     * 批量发货模板
     *
     * @param map
     * @param response
     * @return
     * @throws IOException
     */
    @PostMapping("/batchShipmentsOrderExport")
    public ResponseResult batchShipmentsOrderExport(@RequestBody Map<String, Object> map, HttpServletResponse response) {
        ResponseResult result = orderBaseService.batchShipmentsOrderExport(map, response);
        return result;
    }

    /**
     * 根据店铺id获取未发货订单信息，分页
     *
     * @param param
     * @return
     * @throws IOException
     */
    @PostMapping("/queryUnshippedOrder")
    public ResponseResult queryUnshippedOrder(@RequestBody RetrunQueryPrintDTO param) {
        ResponseResult result = orderBaseService.queryUnshippedOrder(param);
        return result;
    }

    /**
     * 发货订单导出
     *
     * @param map
     * @param response
     * @return
     * @throws IOException
     */
    @PostMapping("/shippingOrderExport")
    public ResponseResult shippingOrderExport(@RequestBody Map<String, Object> map, HttpServletResponse response) {
        ResponseResult result = orderBaseService.shippingOrderExport(map, response);
        return result;
    }

    /**
     * 订单回收站下拉
     *
     * @param map
     * @return
     */
    @PostMapping("/query/recycleBin")
    public ResponseResult queryRecycleBin(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryRecycleBin(map);
        return result;
    }

    /**
     * 查询物流
     *
     * @param map
     * @return
     */
    @PostMapping("/queryLogisticsMessage")
    public ResponseResult queryLogisticsMessage(@RequestBody Map<String,Object> map) {
        ResponseResult result = orderBaseService.queryLogisticsMessage(map);
        return result;
    }

    /**
     * 商家提醒付款
     *
     * @param map
     * @return
     */
    @PostMapping("/remindPay")
    public ResponseResult remindPay(@RequestBody Map<String,Object> map){
        ResponseResult result = orderBaseService.remindPay(map);
        return result;
    }

    /**
     * 待发货订单
     *
     * @param map
     * @return
     */
    @PostMapping("/shipmentsOrder")
    public ResponseResult shipmentsOrder(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.shipmentsOrder(map);
        return result;
    }

    /**
     * 还原回收站订单
     *
     * @param map
     * @return
     */
    @GlobalTransactional
    @PostMapping("/reduction")
    public ResponseResult reduction(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.reduction(map);
        return result;
    }

    /**
     * 回收站界面
     *
     * @param map
     * @return
     */
    @PostMapping("/query/recycleBinPageDetails")
    public ResponseResult queryRecycleBinPageDetails(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryRecycleBinPageDetails(map);
        return result;
    }

    /**
     * 导出回收站界面
     *
     * @param map
     * @return
     */
    @PostMapping("/recycleBinExcel")
    public ResponseResult recycleBinExcel(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.recycleBinExcel(map);
        return result;
    }

    /**
     * 查询用户收货信息与物流名称
     *
     * @param map
     * @return
     */
    @PostMapping("/queryLogisticsName")
    public ResponseResult queryLogisticsName(@RequestBody Map<Object, Object> map) {
        ResponseResult result = orderBaseService.queryLogisticsName(map);
        return result;
    }

    /**
     * 待付款订单改价
     *
     * @param map
     * @return
     */
    @PostMapping("/changeShoppingPrice")
    public ResponseResult changeShoppingPrice(@RequestBody Map<String, Object> map){
        ResponseResult result = orderBaseService.changeShoppingPrice(map);
        return result;
    }


    /**
     * webm门店核销记录
     * @return
     */
    @PostMapping("/cancelShopGateRecord")
    public ResponseResult cancelShopGateRecord(@RequestBody PageUserTokenBeanDTO page){
        ResponseResult result = orderBaseService.cancelShopGateRecord(page);
        return result;
    }

    /**
     * 查询某个店铺下 购买虚拟商品的用户
     *
     * @param page
     * @return
     */
    @PostMapping("/queryVirtualGoodsUser")
    public ResponseResult queryVirtualGoodsUser(@RequestBody PageUserTokenBeanDTO page) {
        ResponseResult result = orderBaseService.queryVirtualGoodsUser(page);
        return result;
    }


    /**
     * 根据shoid 查询已经核销的订单
     *
     * @param page
     * @return
     */
    @PostMapping("/cancelRecord")
    public ResponseResult cancelRecord(@RequestBody PageUserTokenBeanDTO page) {
        ResponseResult result = orderBaseService.cancelRecord(page);
        return result;
    }

    /**
     * 订单信息查询(PC)
     *
     * @param map
     * @return
     */
    @PostMapping("/queryOrdersByPC")
    public ResponseResult queryOrdersByPC(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.queryOrdersByPC(map);
        return result;
    }


    /**
     * @param map
     * @param request
     * @param response
     * @return打印面單
     * @throws ServletException
     * @throws IOException
     */
    @PostMapping("/orderPrint")
    public ResponseResult print(@RequestBody(required = false) Map<String, Object> map, HttpServletRequest request,
                            HttpServletResponse response) throws ServletException, IOException {
        ResponseResult result = orderBaseService.print(map,request,response);
        return result;
    }

    /**
     * 已售订单导出
     *
     * @param map
     * @return
     */
    @PostMapping("/soldOrdersExp")
    public ResponseResult soldOrdersExp(@RequestBody Map<String, Object> map) {
        ResponseResult result = orderBaseService.soldOrdersExp(map);
        return result;
    }

    /**
     * 校验单号
     */
    @PostMapping("/checkodd")
    public ResponseResult checkodd(@RequestBody Map<String,Object> map){
        ResponseResult result = orderBaseService.checkodd(map);
        return result;
    }

    /**
     * 定时任务fegin-确认收货超过14天默认默认好评
     *
     * @return
     */
    @PostMapping("/job/queryNotEvaluatedOrder")
    public ResponseResult queryNotEvaluatedOrder(){
        ResponseResult resultResp = orderBaseService.queryNotEvaluatedOrder();
        return resultResp;
    }
}
